#ifndef __UTIL_H__
#define __UTIL_H__
#include <time.h>
#include <sys/time.h>

class CTools
{
    public:
        static uint64_t GetUnixTime()
        {
            timeval timesnow;
            struct timezone tmpzone;
            gettimeofday(&timesnow,&tmpzone);
            return timesnow.tv_sec;
        }

        static uint64_t GetUnixTimeMs()
        {
            timeval timesnow;
            gettimeofday(&timesnow, NULL);
            return (timesnow.tv_sec * 1000000 + timesnow.tv_usec);
        }
};

#endif